/**
 * ！！！！！！！！！！！！！！！！！！！！！！！！！！！！1
* 请不要随意修改tableOption里column数组元素的顺序，也不要随意添加数组元素！！！！！！！！！！
* ！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！
* **/
const dicData = [
  {label: '部分',value: '1'},
  {label: '全部',value: '2'}
]
export const tableOption = {
  searchMenuSpan: 12,
  // expand: true,
  // expandRowKeys:[1],
  editBtn: false,
  delBtn: false,
  viewBtn: true,
  rowKey:'msgId',
  column: [
    {
      label: 'msgId',
      prop: 'msgId',
      hide: true,
      display: false,
      showColumn: false,
    },
    {
      label: '标题',
      search: true,
      prop: 'msgTitle',
      maxlength: 30,
      showWordLimit: true,
      overHidden: true,
      span: 24,
      rules: [
        { required: true, message: '请输入标题', trigger: 'blur' },
      ]
    },
    {
      label: '类型',
      prop: 'msgType',
      type: 'select',
      dicUrl: '/admin/dict/type/message_type',
      span: 24,
      rules: [{
        required: true,
        message: '请选择类型',
        trigger: 'blur'
      }],
      search: true
    },
    {
      label: '内容',
      prop: 'msgContent',
      span: 24,
      hide: true,
      showColumn: false,
      formslot: true,
      rules: [{
        required: true,
        message: '请输入消息内容',
        trigger: 'blur'
      }],
    },
    {
      label: '接收范围',
      prop: 'receiveRange',
      type: 'radio',
      border:true,
      dicData: dicData,
      value: '1',
      rules: [{
        required: true,
        message: '接收范围',
        trigger: ['change','blur']
      }],
      change: ({
                 value,
                 column
               }) => {
        if (value === '1') {
          tableOption.column[5].addDisplay = true
          tableOption.column[5].editDisplay = true
        } else if (value === '2') {
          tableOption.column[5].addDisplay = false
          tableOption.column[5].editDisplay = false
        }
      }
    },
    {
      label: '接收对象',
      prop: 'receive',
      type: 'select',
      slot: true,
      hide: true,
      span: 24,
      showColumn: false,
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      formslot: true,
      // rules: [{
      //   required: true,
      //   message: '请选择发送人',
      //   trigger: ['change','blur']
      // }],
    },
    {
      label: '发送方式',
      prop: 'sendChannels',
      type: 'checkbox',
      border:true,
      dicUrl: '/admin/dict/type/msg_channel',
      span: 24,
      rules: [{
        required: true,
        message: '请选择发送方式',
        trigger: 'blur'
      }],
      value: ['3']
    },

    {
      label: '发送时间',
      prop: 'sendType',
      type: 'radio',
      border:true,
      hide: true,
      showColumn: false,
      addDisplay: false,
      editDisplay: false,
      formslot: true,
      dicUrl: '/admin/dict/type/msg_time_type',
      span: 24,
      value:'1',
      rules: [{
        required: true,
        message: '请选择发送时间',
        trigger: ['change', 'blur']

      }],
      display: false,
    },
    {
      label: '用户',
      prop: 'sysMsgRecievers',
      type: 'array',
      value: [],
      hide: true,
      showColumn: false,
      display: false,
    },
    {
      label: '角色',
      prop: 'sysMsgRoles',
      type: 'array',
      value: [],
      hide: true,
      showColumn: false,
      display: false,
    },
    {
      label: '部门',
      prop: 'sysMsgDepts',
      type: 'array',
      value: [],
      hide: true,
      showColumn: false,
      display: false,
    },
  ]
}

